 <script th:inline="javascript">
/*<![CDATA[*/

    function del(event,element){
    	event.preventDefault();
      	bootbox.confirm("您确定删除吗?", function(result) {
    	if(result){
    		var _id = $(element).attr("href").split("_")[0];
    		var _spid = $(element).attr("href").split("_")[1];
    		var _page=$(element).attr("href").split("_")[2];
    		BOSS.remoteCall('promotion/creditpromotiongoods/delete',$('#div_creditpromotiongoods_grid'),{id:_id,spid:_spid,page:_page});
    		}
    	}); 
    }
	
/*]]>*/
</script>
<table layout:fragment="cerditpromotion_table" class="table table-striped table-bordered  table-advance table-hover" id="creditpromotion_grid">
	<thead>
		<tr>
			<th>ID</th>
			<th>商品名称</th>
            <th>货号</th>
            <th>价格</th>
			<th th:if="${creditPromotion.creditType.description} == '倍数'">倍数</th>
			<th th:if="${creditPromotion.creditType.description} == '积分'">积分值</th>
			<th>添加时间</th>
			<th>操作</th>
		</tr>
	</thead>	
	<tbody>
		<tr class="odd gradeX" th:each="data : ${creditpromotiongoodsPage}">
			<td th:text="${data.id}">
				 
			</td>
			<td th:text="${data.goods.name}">
				 
			</td>
            <td th:text="${data.goods.goodsSN}">

			</td>
            <td th:text="${data.goods.shopPrice}">

			</td>
			<td th:if="${creditPromotion.creditType.description} == '倍数'" th:text="${data.multiple}">
			
			</td>
			<td th:if="${creditPromotion.creditType.description} == '积分'" th:text="${data.credit}">
				 
			</td>
			<td th:text="${#calendars.format(data.createdDate,'yyyy-MM-dd HH:mm:ss')}">
			
			</td>
			<td>
				<a href="#" th:href="@{'/promotion/creditpromotiongoods/edit/'+${creditPromotionId}+'/'+${data.id}}" th:attr="id=${'link_edit_'+dataStat.index},name=${'link_edit_'+dataStat.index}" class="btn default btn-xs purple"><i class="fa fa-minus"></i>编辑</a>|
				<a href="#" th:href="${data.id}+'_'+${creditPromotionId}+'_'+${creditpromotiongoodsPage.number}" th:attr="id=${'link_delete_'+dataStat.index},name=${'link_delete_'+dataStat.index}" class="btn default btn-xs purple" onclick="del(event,this);"><i class="fa fa-minus"></i>移除</a>
			</td>	 
		</tr>
 	</tbody>
</table>
<div th:include="page_footer" th:with="viewState=${viewState},url=${'/promotion/creditpromotiongoods/index/'+creditPromotionId+'/'},pageContext=${creditpromotiongoodsPage}"></div>